package com.itheima.service.impl;

import com.itheima.dao.TFileMapper;
import com.itheima.pojo.TFile;
import com.itheima.service.TFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.ArrayList;
import java.util.List;

@Service
public class TFileServiceImpl implements TFileService {

    @Autowired
    private TFileMapper tFileMapper;
    /**
     * //获取uid数组，切割逗号，获取每一个uid的图片信息存入list集合返回
     * @param fileIds
     * @param code
     * @return
     */
    @Override
    public List<List<TFile>> getPicture(String fileIds, String code) {
        if(code==null){
            code=",";
        }
        String[]arrays=fileIds.split(",");
        List<List<TFile>>arrayList=new ArrayList<>();
        for (String array : arrays) {
            arrayList.add(tFileMapper.selectByTFileUid(array));
        }
        return arrayList;
    }
}
